package ink.ykb.demo.permission.service;

import java.util.List;

import ink.ykb.demo.permission.entity.DealerDepartment;

public interface DealerDepartmentService {

  /**
   * 添加经销商层级
   * @param dealerDepartment
   */
  void add(DealerDepartment dealerDepartment);
  
  /**
   * 更新经销商层级
   * @param dealerDepartment
   */
  void update(DealerDepartment dealerDepartment);
  
  /**
   * 删除经销商层级
   * @param dealerDepartmentId
   */
  void delete(Long dealerDepartmentId);
  
  /**
   * 查询经销商层级列表
   * @return
   */
  List<DealerDepartment> getDealerDepartmentList();
  
  /**
   * 获取经销商层级信息
   * @param dealerDepartmentId
   * @return
   */
  DealerDepartment getDealerDepartment(Long dealerDepartmentId);
  
  /**
   * 根据父级部门查询子集部门
   * @param parentId
   * @return
   */
  List<DealerDepartment> getByParentId(Long parentId);
  
	/**
	 * 递归展开部门里面所有的子集部门
	 * @param dealerDepartment 此部门必须为部门树，包含所有子部门的数据
	 * @return
	 */
	List<DealerDepartment> getAllByTree(DealerDepartment dealerDepartment);
  
  /**
   * 根据父级部门查询所有子集部门树
   * 
   * @param parentId
   * @return
   */
  List<DealerDepartment> getDealerDepartmentTree(Long parentId);
  
  /**
   * 根据部门ID查询完整部门树 <br>
   * 结构：从根节点 --> 当前节点 --> 所有可达的子节点
   * @param dealerDepartmentId
   * @return 根节点
   */
  DealerDepartment getDealerDepartmentTreeByRoot(Long dealerDepartmentId);
  
  /**
   * 根据部门ID查询完整的从父级部门到当前部门的树 <br>
   * 结构：从根节点 --> 当前节点
   * @param dealerDepartmentId
   * @return 根节点
   */
  DealerDepartment getDealerDepartmentTreeToRoot(Long dealerDepartmentId);
  
  /**
   * 根据部门ID查询完整的从父级部门到当前部门的树 <br>
   * 结构：从根节点 --> 当前节点
   * @param dealerDepartment
   * @return 根节点
   */
  DealerDepartment getDealerDepartmentTreeToRoot(DealerDepartment dealerDepartment);
  
  
}
